<!DOCTYPE html>
<html>
<head>
	<title>后台</title>
	<link rel="stylesheet" type="text/css" href="/bower_components\bootstrap\dist\css\bootstrap.min.css">
	<link rel="stylesheet" type="text/css" href="/style/article.css">
	<script type="text/javascript" src = '/bower_components\jquery\dist\jquery.min.js'></script>
	<script type="text/javascript" src='/bower_components\bootstrap\dist\js\bootstrap.min.js'></script>
</head>
<body>
	<div id="top">
		<div class="container">
			<span class="pull-right"><a href="">欢迎<%= username%></a><a href="addmin/loginout">退出</a></span>
		</div>
	</div>
	<div class="container">
			<% if(success!=""){%>
				<div  class="alert alert-success" role="alert">
					<button type="button" class="close" data-dismiss="alert" aria-label="Close"><span aria-hidden="true">&times;</span></button>
				<%= success%></div>
			<%}%>
		<div class="row">
			<div class="col-md-12">
				<div class="page-header">
					<a href="/addmin/addArticle" class="btn"><添加文章</a>
					数据清单
				</div>
				<table class="table">
					<tr>
						<th>ID</th>
						<th>标题</th>
						<th>内容</th>
						<th>图片</th>
						<th width="88">分类</th>
						<th>操作</th>
					</tr>
					<% for( var i = 0; i<article.length; i++){ %>
						<tr>
							<td><%= article[i].aid%></td>
							<td><%= article[i].title%></td>
							<td><%= article[i].content%></td>
							<td><img width="58" src="<%= article[i].img%>"></td>
							<td><%= article[i].name%></td>
							<td>
								<a href="/addmin/degArticle?id=<%= article[i].aid%>" class="btn btn-xs btn-success">编辑</a>
								<a href="/addmin/delarticle?id=<%= article[i].aid%>" class="btn btn-xs btn-danger">删除</a>
							</td>
						</tr>
						<%}%>
				</table>
			</div>
		</div>
		<script type="text/javascript">
			setTimeout(function(){
				$(".alert").fadeOut("close")
			},2000)
			$(function(){
				$.get("/addmin/test",function(res,status){
					if (status=="success") {
						alert(res)
					}
				})
			})
		</script>
</body>
</html>